import request from './request'

// 用户注册
export const userRegister = (url, user) => {
    return request({
        url: 'proxy' + url,
        data: user,
        method: 'post'
    })
}

// 用户登录
export const userLogin = (url, user) => {
    return request({
        url: 'proxy' + url,
        data: user,
        method: 'post'
    })
}

// 退出登录
export const userlogout = (url) => {
    return request({
        url: 'proxy' + url,
        method: 'post'
    })
}

// 获取用户信息
export const getUserinfo = (url) => {
    return request({
        url: 'proxy' + url,
        mathod: 'get'
    })
}

// 修改用户信息
export const updateUserinfo = (url, user) => {
    return request({
        url: 'proxy' + url,
        data: user,
        method: 'post'
    })
}

// 展示用户
export const listUsers = (url, req) => {
    return request({
        url: 'proxy' + url,
        params: req,
        method: 'get'
    })
}

// 创建专家账号
export const createExpert = (url, req) => {
    return request({
        url: 'proxy' + url,
        data: req,
        method: 'post'
    })
}

// 删除用户
export const deleteUser = (url, req) => {
    return request({
        url: 'proxy' + url,
        params: req,
        method: 'delete'
    })
}

// 用户反馈
export const userFeedback = (url, req) => {
    return request({
        url: 'proxy' + url,
        data: req,
        method: 'post'
    })
}

// 用户反馈列表
export const userFeedbackList = (url, req) => {
    return request({
        url: 'proxy' + url,
        params: req,
        method: 'get'
    })
}

// 用户反馈统计
export const userFeedbackStatistics = (url) => {
    return request({
        url: 'proxy' + url,
        method: 'get'
    })
}

// 智能搜索
export const intelligentSearch = (url, req) => {
    return request({
        url: 'proxy' + url,
        params: req,
        method: 'get'
    })
}

// 删除专家
export const deleteExpert = (url, id) => {
    return request({
        url: 'proxy' + url,
        params: id,
        method: 'delete'
    })
}

// 删除用户反馈
export const deleteUserFeedback = (url, id) => {
    return request({
        url: 'proxy' + url,
        params: id,
        method: 'delete'
    })
}

// 发送邮件
export const sendEmil = (data) => {
    return request({
        url: 'proxy/email/send',
        method: 'post',
        data: data
    })
}

// 获取邮件列表
export const getEmilList = (data) => {
    return request({
        url: 'proxy/email/list',
        params: data,
        method: 'get'
    })
}